It is often desirable to migrate program code from one computing environment to another to provide analogous functionality in different computing environments. One of the goals of such a migration is to reduce program-code development costs by sharing a single instance of program source code (for example, a device driver) across a number of computing environments or platforms. Therefore, it is advantageous to not change the shared program source code simply to accommodate platform differences. One problem that arises is that various operating systems for computing environments use different approaches for managing resources of a computing environment.
For example, in a UNIX device driver, the memory used to represent a lock is typically placed directly in the control blocks of the resource that the lock is being used to control. As a result, this memory is uncontrollably accessible to and changeable by any program in the computing environment which has access to the enclosing control block. While this is normal practice in the UNIX environment, other computing environments exist which do not directly expose resources of the computing environment to programs executing in the operating environment. Therefore, there is a need in the art for a technique of migrating existing program code from a native computing environment to a target computing environment that addresses the problem of the different placement of computing-environment resources while maintaining a single instance of an existing program's source code.